﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccessLayer;

namespace BusinessComponents
{
    class VoucherBLL
    {
        private VoucherRepository voucherRepository = new VoucherRepository();

        public bool ValidateVoucherNumber(string voucherNumber)
        {
            bool result = true;
            Voucher voucher = voucherRepository.FindByVourcherNumber(voucherNumber);
            if (voucher == null || voucher.VoucherStatus != (int) VoucherStatus.Valid)
            {
                result = false;
            }

            return result;
        }

        public Voucher getVoucher(string voucherNo)
        {
            return voucherRepository.FindByVourcherNumber(voucherNo);
        }
    }
}
